﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract ShemaKnjizenjaRobno typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ShemaKnjizenjaRobnoDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<ShemaKnjizenjaRobnoDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.ShemaKnjizenjaRobno _currentShemaKnjizenjaRobno = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxShemaKnjizenjaRobnoDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxShemaKnjizenjaRobnoErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxShemaKnjizenjaRobnoBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDDokumentTip property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDDokumentTipDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDKolonaZaPrebacivanje property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDKolonaZaPrebacivanjeDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the KontoZaPrebacivanje property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxKontoZaPrebacivanjeDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDVrstaFinDokumenta property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDVrstaFinDokumentaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DugIliPot property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxDugIliPotDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the RedBr property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxRedBrDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the SklRobeSklPrema property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxSklRobeSklPremaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Maloprodaja property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxMaloprodajaDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.DokumentTip> _IDDokumentTipList;
		
		/// <summary> 
		/// The list of selectable DokumentTip
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.DokumentTip> IDDokumentTipList
		{
			get {return this._IDDokumentTipList;}
			set 
			{
				this._IDDokumentTipList = value;
				this.uxIDDokumentTipDataGridViewColumn.DataSource = null;
				this.uxIDDokumentTipDataGridViewColumn.DataSource = this._IDDokumentTipList;
			}
		}
		
		private bool _allowNewItemInIDDokumentTipList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of DokumentTip
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDDokumentTipList
		{
			get { return _allowNewItemInIDDokumentTipList;}
			set
			{
				this._allowNewItemInIDDokumentTipList = value;
				this.uxIDDokumentTipDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.ShemaKnjizenjeNazivKolona> _IDKolonaZaPrebacivanjeList;
		
		/// <summary> 
		/// The list of selectable ShemaKnjizenjeNazivKolona
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.ShemaKnjizenjeNazivKolona> IDKolonaZaPrebacivanjeList
		{
			get {return this._IDKolonaZaPrebacivanjeList;}
			set 
			{
				this._IDKolonaZaPrebacivanjeList = value;
				this.uxIDKolonaZaPrebacivanjeDataGridViewColumn.DataSource = null;
				this.uxIDKolonaZaPrebacivanjeDataGridViewColumn.DataSource = this._IDKolonaZaPrebacivanjeList;
			}
		}
		
		private bool _allowNewItemInIDKolonaZaPrebacivanjeList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of ShemaKnjizenjeNazivKolona
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDKolonaZaPrebacivanjeList
		{
			get { return _allowNewItemInIDKolonaZaPrebacivanjeList;}
			set
			{
				this._allowNewItemInIDKolonaZaPrebacivanjeList = value;
				this.uxIDKolonaZaPrebacivanjeDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.VrstaFinDokumenta> _IDVrstaFinDokumentaList;
		
		/// <summary> 
		/// The list of selectable VrstaFinDokumenta
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.VrstaFinDokumenta> IDVrstaFinDokumentaList
		{
			get {return this._IDVrstaFinDokumentaList;}
			set 
			{
				this._IDVrstaFinDokumentaList = value;
				this.uxIDVrstaFinDokumentaDataGridViewColumn.DataSource = null;
				this.uxIDVrstaFinDokumentaDataGridViewColumn.DataSource = this._IDVrstaFinDokumentaList;
			}
		}
		
		private bool _allowNewItemInIDVrstaFinDokumentaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of VrstaFinDokumenta
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDVrstaFinDokumentaList
		{
			get { return _allowNewItemInIDVrstaFinDokumentaList;}
			set
			{
				this._allowNewItemInIDVrstaFinDokumentaList = value;
				this.uxIDVrstaFinDokumentaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.ShemaKnjizenjaRobno> _ShemaKnjizenjaRobnoList;
				
		/// <summary> 
		/// The list of ShemaKnjizenjaRobno to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.ShemaKnjizenjaRobno> ShemaKnjizenjaRobnoList
		{
			get {return this._ShemaKnjizenjaRobnoList;}
			set
			{
				this._ShemaKnjizenjaRobnoList = value;
				this.uxShemaKnjizenjaRobnoBindingSource.DataSource = null;
				this.uxShemaKnjizenjaRobnoBindingSource.DataSource = value;
				this.uxShemaKnjizenjaRobnoDataGridView.DataSource = null;
				this.uxShemaKnjizenjaRobnoDataGridView.DataSource = this.uxShemaKnjizenjaRobnoBindingSource;				
				//this.uxShemaKnjizenjaRobnoBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxShemaKnjizenjaRobnoBindingSource_ListChanged);
				this.uxShemaKnjizenjaRobnoBindingSource.CurrentItemChanged += new System.EventHandler(OnShemaKnjizenjaRobnoBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnShemaKnjizenjaRobnoBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentShemaKnjizenjaRobno = uxShemaKnjizenjaRobnoBindingSource.Current as Entities.ShemaKnjizenjaRobno;
			
			if (_currentShemaKnjizenjaRobno != null)
			{
				_currentShemaKnjizenjaRobno.Validate();
			}
			//_ShemaKnjizenjaRobno.Validate();
			OnCurrentEntityChanged();
		}

		//void uxShemaKnjizenjaRobnoBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.ShemaKnjizenjaRobno"/> instance.
		/// </summary>
		public Entities.ShemaKnjizenjaRobno SelectedShemaKnjizenjaRobno
		{
			get {return this._currentShemaKnjizenjaRobno;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxShemaKnjizenjaRobnoDataGridView.VirtualMode;}
			set
			{
				this.uxShemaKnjizenjaRobnoDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxShemaKnjizenjaRobnoDataGridView.AllowUserToAddRows;}
			set {this.uxShemaKnjizenjaRobnoDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxShemaKnjizenjaRobnoDataGridView.AllowUserToDeleteRows;}
			set {this.uxShemaKnjizenjaRobnoDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxShemaKnjizenjaRobnoDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxShemaKnjizenjaRobnoDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="ShemaKnjizenjaRobnoDataGridViewBase"/> class.
		/// </summary>
		public ShemaKnjizenjaRobnoDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxShemaKnjizenjaRobnoDataGridView = new System.Windows.Forms.DataGridView();
			this.uxShemaKnjizenjaRobnoBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxShemaKnjizenjaRobnoErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDDokumentTipDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDKolonaZaPrebacivanjeDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxKontoZaPrebacivanjeDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDVrstaFinDokumentaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxDugIliPotDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxRedBrDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxSklRobeSklPremaDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxMaloprodajaDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			//this.uxIDDokumentTipBindingSource = new DokumentTipBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDDokumentTipBindingSource)).BeginInit();
			//this.uxIDKolonaZaPrebacivanjeBindingSource = new ShemaKnjizenjeNazivKolonaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDKolonaZaPrebacivanjeBindingSource)).BeginInit();
			//this.uxIDVrstaFinDokumentaBindingSource = new VrstaFinDokumentaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDVrstaFinDokumentaBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxShemaKnjizenjaRobnoDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxShemaKnjizenjaRobnoBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxShemaKnjizenjaRobnoErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxShemaKnjizenjaRobnoErrorProvider
			// 
			this.uxShemaKnjizenjaRobnoErrorProvider.ContainerControl = this;
			this.uxShemaKnjizenjaRobnoErrorProvider.DataSource = this.uxShemaKnjizenjaRobnoBindingSource;						
			// 
			// uxShemaKnjizenjaRobnoDataGridView
			// 
			this.uxShemaKnjizenjaRobnoDataGridView.AutoGenerateColumns = false;
			this.uxShemaKnjizenjaRobnoDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxShemaKnjizenjaRobnoDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxIDDokumentTipDataGridViewColumn,
		this.uxIDKolonaZaPrebacivanjeDataGridViewColumn,
		this.uxKontoZaPrebacivanjeDataGridViewColumn,
		this.uxIDVrstaFinDokumentaDataGridViewColumn,
		this.uxDugIliPotDataGridViewColumn,
		this.uxRedBrDataGridViewColumn,
		this.uxSklRobeSklPremaDataGridViewColumn,
		this.uxMaloprodajaDataGridViewColumn			});
			this.uxShemaKnjizenjaRobnoDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxShemaKnjizenjaRobnoDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxShemaKnjizenjaRobnoDataGridView.Name = "uxShemaKnjizenjaRobnoDataGridView";
			this.uxShemaKnjizenjaRobnoDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxShemaKnjizenjaRobnoDataGridView.TabIndex = 0;	
			this.uxShemaKnjizenjaRobnoDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxShemaKnjizenjaRobnoDataGridView.EnableHeadersVisualStyles = false;
			this.uxShemaKnjizenjaRobnoDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnShemaKnjizenjaRobnoDataGridViewDataError);
			this.uxShemaKnjizenjaRobnoDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnShemaKnjizenjaRobnoDataGridViewCellValueNeeded);
			this.uxShemaKnjizenjaRobnoDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnShemaKnjizenjaRobnoDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxIDDokumentTipDataGridViewColumn
			//
			this.uxIDDokumentTipDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDokumentTipDataGridViewColumn.DataPropertyName = "IDDokumentTip";
			this.uxIDDokumentTipDataGridViewColumn.HeaderText = "IDDokumentTip";
			this.uxIDDokumentTipDataGridViewColumn.Name = "uxIDDokumentTipDataGridViewColumn";
			this.uxIDDokumentTipDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDokumentTipDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDokumentTipDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDKolonaZaPrebacivanjeDataGridViewColumn
			//
			this.uxIDKolonaZaPrebacivanjeDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDKolonaZaPrebacivanjeDataGridViewColumn.DataPropertyName = "IDKolonaZaPrebacivanje";
			this.uxIDKolonaZaPrebacivanjeDataGridViewColumn.HeaderText = "IDKolonaZaPrebacivanje";
			this.uxIDKolonaZaPrebacivanjeDataGridViewColumn.Name = "uxIDKolonaZaPrebacivanjeDataGridViewColumn";
			this.uxIDKolonaZaPrebacivanjeDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDKolonaZaPrebacivanjeDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDKolonaZaPrebacivanjeDataGridViewColumn.ReadOnly = false;		
			//
			// uxKontoZaPrebacivanjeDataGridViewColumn
			//
			this.uxKontoZaPrebacivanjeDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxKontoZaPrebacivanjeDataGridViewColumn.DataPropertyName = "KontoZaPrebacivanje";
			this.uxKontoZaPrebacivanjeDataGridViewColumn.HeaderText = "KontoZaPrebacivanje";
			this.uxKontoZaPrebacivanjeDataGridViewColumn.Name = "uxKontoZaPrebacivanjeDataGridViewColumn";
			this.uxKontoZaPrebacivanjeDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxKontoZaPrebacivanjeDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxKontoZaPrebacivanjeDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDVrstaFinDokumentaDataGridViewColumn
			//
			this.uxIDVrstaFinDokumentaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDVrstaFinDokumentaDataGridViewColumn.DataPropertyName = "IDVrstaFinDokumenta";
			this.uxIDVrstaFinDokumentaDataGridViewColumn.HeaderText = "IDVrstaFinDokumenta";
			this.uxIDVrstaFinDokumentaDataGridViewColumn.Name = "uxIDVrstaFinDokumentaDataGridViewColumn";
			this.uxIDVrstaFinDokumentaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDVrstaFinDokumentaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDVrstaFinDokumentaDataGridViewColumn.ReadOnly = false;		
			//
			// uxDugIliPotDataGridViewColumn
			//
			this.uxDugIliPotDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDugIliPotDataGridViewColumn.DataPropertyName = "DugIliPot";
			this.uxDugIliPotDataGridViewColumn.HeaderText = "DugIliPot";
			this.uxDugIliPotDataGridViewColumn.Name = "uxDugIliPotDataGridViewColumn";
			this.uxDugIliPotDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDugIliPotDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDugIliPotDataGridViewColumn.ReadOnly = false;		
			//
			// uxRedBrDataGridViewColumn
			//
			this.uxRedBrDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxRedBrDataGridViewColumn.DataPropertyName = "RedBr";
			this.uxRedBrDataGridViewColumn.HeaderText = "RedBr";
			this.uxRedBrDataGridViewColumn.Name = "uxRedBrDataGridViewColumn";
			this.uxRedBrDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxRedBrDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxRedBrDataGridViewColumn.ReadOnly = false;		
			//
			// uxSklRobeSklPremaDataGridViewColumn
			//
			this.uxSklRobeSklPremaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxSklRobeSklPremaDataGridViewColumn.DataPropertyName = "SklRobeSklPrema";
			this.uxSklRobeSklPremaDataGridViewColumn.HeaderText = "SklRobeSklPrema";
			this.uxSklRobeSklPremaDataGridViewColumn.Name = "uxSklRobeSklPremaDataGridViewColumn";
			this.uxSklRobeSklPremaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxSklRobeSklPremaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxSklRobeSklPremaDataGridViewColumn.ReadOnly = false;		
			//
			// uxMaloprodajaDataGridViewColumn
			//
			this.uxMaloprodajaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxMaloprodajaDataGridViewColumn.DataPropertyName = "Maloprodaja";
			this.uxMaloprodajaDataGridViewColumn.HeaderText = "Maloprodaja";
			this.uxMaloprodajaDataGridViewColumn.Name = "uxMaloprodajaDataGridViewColumn";
			this.uxMaloprodajaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxMaloprodajaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxMaloprodajaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDDokumentTipDataGridViewColumn
			//				
			this.uxIDDokumentTipDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDDokumentTipDataGridViewColumn.ValueMember = "ID";	
			this.uxIDDokumentTipDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDDokumentTipDataGridViewColumn.DataSource = uxIDDokumentTipBindingSource;				
				
			//
			// uxIDKolonaZaPrebacivanjeDataGridViewColumn
			//				
			this.uxIDKolonaZaPrebacivanjeDataGridViewColumn.DisplayMember = "Kolona";	
			this.uxIDKolonaZaPrebacivanjeDataGridViewColumn.ValueMember = "ID";	
			this.uxIDKolonaZaPrebacivanjeDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDKolonaZaPrebacivanjeDataGridViewColumn.DataSource = uxIDKolonaZaPrebacivanjeBindingSource;				
				
			//
			// uxIDVrstaFinDokumentaDataGridViewColumn
			//				
			this.uxIDVrstaFinDokumentaDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDVrstaFinDokumentaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDVrstaFinDokumentaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDVrstaFinDokumentaDataGridViewColumn.DataSource = uxIDVrstaFinDokumentaBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxShemaKnjizenjaRobnoDataGridView);
			this.Name = "ShemaKnjizenjaRobnoDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDDokumentTipBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDKolonaZaPrebacivanjeBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDVrstaFinDokumentaBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxShemaKnjizenjaRobnoErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxShemaKnjizenjaRobnoDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxShemaKnjizenjaRobnoBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				ShemaKnjizenjaRobnoDataGridViewEventArgs args = new ShemaKnjizenjaRobnoDataGridViewEventArgs();
				args.ShemaKnjizenjaRobno = _currentShemaKnjizenjaRobno;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class ShemaKnjizenjaRobnoDataGridViewEventArgs : System.EventArgs
		{
			private Entities.ShemaKnjizenjaRobno	_ShemaKnjizenjaRobno;
	
			/// <summary>
			/// the  Entities.ShemaKnjizenjaRobno instance.
			/// </summary>
			public Entities.ShemaKnjizenjaRobno ShemaKnjizenjaRobno
			{
				get { return _ShemaKnjizenjaRobno; }
				set { _ShemaKnjizenjaRobno = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxShemaKnjizenjaRobnoDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnShemaKnjizenjaRobnoDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxShemaKnjizenjaRobnoDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnShemaKnjizenjaRobnoDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxShemaKnjizenjaRobnoDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = ShemaKnjizenjaRobnoList[e.RowIndex].ID;
						break;
					case "uxIDDokumentTipDataGridViewColumn":
						e.Value = ShemaKnjizenjaRobnoList[e.RowIndex].IDDokumentTip;
						break;
					case "uxIDKolonaZaPrebacivanjeDataGridViewColumn":
						e.Value = ShemaKnjizenjaRobnoList[e.RowIndex].IDKolonaZaPrebacivanje;
						break;
					case "uxKontoZaPrebacivanjeDataGridViewColumn":
						e.Value = ShemaKnjizenjaRobnoList[e.RowIndex].KontoZaPrebacivanje;
						break;
					case "uxIDVrstaFinDokumentaDataGridViewColumn":
						e.Value = ShemaKnjizenjaRobnoList[e.RowIndex].IDVrstaFinDokumenta;
						break;
					case "uxDugIliPotDataGridViewColumn":
						e.Value = ShemaKnjizenjaRobnoList[e.RowIndex].DugIliPot;
						break;
					case "uxRedBrDataGridViewColumn":
						e.Value = ShemaKnjizenjaRobnoList[e.RowIndex].RedBr;
						break;
					case "uxSklRobeSklPremaDataGridViewColumn":
						e.Value = ShemaKnjizenjaRobnoList[e.RowIndex].SklRobeSklPrema;
						break;
					case "uxMaloprodajaDataGridViewColumn":
						e.Value = ShemaKnjizenjaRobnoList[e.RowIndex].Maloprodaja;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxShemaKnjizenjaRobnoDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnShemaKnjizenjaRobnoDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxShemaKnjizenjaRobnoDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						ShemaKnjizenjaRobnoList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxIDDokumentTipDataGridViewColumn":
						ShemaKnjizenjaRobnoList[e.RowIndex].IDDokumentTip = (System.Int32)e.Value;
						break;
					case "uxIDKolonaZaPrebacivanjeDataGridViewColumn":
						ShemaKnjizenjaRobnoList[e.RowIndex].IDKolonaZaPrebacivanje = (System.Int32)e.Value;
						break;
					case "uxKontoZaPrebacivanjeDataGridViewColumn":
						ShemaKnjizenjaRobnoList[e.RowIndex].KontoZaPrebacivanje = (System.String)e.Value;
						break;
					case "uxIDVrstaFinDokumentaDataGridViewColumn":
						ShemaKnjizenjaRobnoList[e.RowIndex].IDVrstaFinDokumenta = (System.Int32)e.Value;
						break;
					case "uxDugIliPotDataGridViewColumn":
						ShemaKnjizenjaRobnoList[e.RowIndex].DugIliPot = (System.Boolean)e.Value;
						break;
					case "uxRedBrDataGridViewColumn":
						ShemaKnjizenjaRobnoList[e.RowIndex].RedBr = (System.Int32?)e.Value;
						break;
					case "uxSklRobeSklPremaDataGridViewColumn":
						ShemaKnjizenjaRobnoList[e.RowIndex].SklRobeSklPrema = (System.Boolean)e.Value;
						break;
					case "uxMaloprodajaDataGridViewColumn":
						ShemaKnjizenjaRobnoList[e.RowIndex].Maloprodaja = (System.Boolean)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
